<include file="public@header"/>
<style type="text/css">
    .table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td {
            border:1px solid #232525;width: 50%;
        }

    .conn{
        width:100%;
        height:auto;
        overflow:hidden;
        background:#f3f3f3;
        margin-top:15px;
    }
    .conn ul{
        width:100%;
        height:auto;
        overflow:hidden;
        padding-left: 0px!important;
    }
    .conn ul li{
        width:100%;
        height:auto;
        overflow:hidden;
        margin-top:15px;
    }
    .conn_t{
        height:30px;
        overflow:hidden;
    }
    .conn_t p{
        font-size:18px;
        float:left;
        color:#666666;
        line-height: 30px;
    }
    .conn_t a{
        display:block;
        float:right!important;
        font-size:16px;
        float:left;
        line-height:30px;
        color:#4abde7;
        text-decoration: underline;
    }
    .conn_b{
        height:auto;
        overflow:hidden;
        background:#fff;
    }
    .conn_b div{
        height:auto;
        border-bottom:1px solid #e6e6e6;
        padding-top: 10px;
        padding-bottom: 10px;
        padding-left: 10px;
    }
    .conn_b div p{
        margin: 0;
        font-size:15px;
    }
    .conn_b div p img{
        float:right;
        width: 20px;
    }
    .conn_b div span{
        display:block;
        margin: 0;
        font-size:15px;
        color:#ff9900;
        margin-top:10px;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
   
    <span style="float: right;height:50px;padding: 15px 0px;">ID:{$Request.param.mytask_id}</span>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('template/listOrder')}">
        <table class="table table-hover table-bordered table-list" >
            <tbody>
                <foreach name="data['header']" item="vo" key="key">
                    <tr>
                        <td >{$key}</td>
                        <td >{$vo}</td>	
                    </tr>
                </foreach>
            </tbody>
        </table>
        <ul style=" margin-top: 10px;">
            <php> for($i=1;$i<=$data_template['template']['progress'];$i++){</php>
                <div class="conn_t">
                    <p>步骤{$i}：</p>
                </div>
                <div class="conn_b">
                    <foreach name="data.template" item="vo">
                        <foreach name="vo.content" item="v">
                            <if condition="$v['progressid'] eq $i">
                                <div>
                                    <p>{$v.question}
                                        <if condition="$data.add_status == 2">
                                            <a href="javascript:ping({$v.anser_param.mytask_id},{$v.anser_param.user_id},{$v.anser_param.classprogressid},{$Request.param.group_id})" style="float: right">评价</a>
                                        </if>
                                    </p>
                                    <if condition="is_array($v.reply)">
                                        <foreach name="v.reply" item="vi">
                                           
                                            <if condition="$vi != ''">
                                                <php>
                                                    $das=explode(',',$vi);

                                                </php>
                                                <foreach name="das" item="vj">
                                                    <php>
                                                        $da=explode('|',$vj);
                                                    </php>
                                          
                                                    <if condition="$da[0] === '0'">
                                                        <span>{$da[1]}</span>
                                                    <elseif condition="$da[0] == 1"/>
                                                        <img src="{$da[1]}" style="width:60%" />
                                                    <elseif condition="$da[0] == 2"/>
                                                        <div class="tb-sp">
                                                            <video poster="{$da[1]}?vframe/jpg/offset/1" src="{$da[1]}" controls="controls" style="width:50%">
                                                            您的浏览器不支持 video 标签。
                                                            </video>
                                                        </div>
                                                    <elseif condition="$da[0] == 3||$da[0] == 4"/>
                                                        <php>$da=explode('-',$da[1]);</php>
                                                        <span>音频文件:{$da[0]}</span>
                                                    </if>
                                                </foreach>
                                            </if>
                                        </foreach>
                                    <else/>
                                        <span>{$v.reply}</span>
                                    </if>
                                    <notempty name="$v.reply_evaluate">
                                        <span>评语:{$v.reply_evaluate}</span>
                                    </notempty>
                                </div>
                            </if>
                        </foreach>
                    </foreach>
                </div>
            <php>}</php>
        </ul>
        <table class="table table-hover table-bordered table-list">
            <tbody>
                <foreach name="data['footer']" item="vo" key="key">
                    <tr>
                        <td >{$key}</td>
                        <td >{$vo}</td>  
                    </tr>
                </foreach> 
            </tbody>  
        </table> 
        <if condition="$data.add_status == 2">
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="button" class="btn btn-primary js-ajax-submit" onclick="refuse({$Request.param.mytask_id},{$Request.param.user_id})">驳回</button>
                    <button type="button" class="btn btn-primary js-ajax-submit" onclick="play({$Request.param.mytask_id},{$Request.param.user_id},{$Request.param.group_id})">通过</button>
                </div>
            </div>
        </if>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    function ping(mytask_id,user_id,classprogressid,group_id){
        //console.log(mytask_id);console.log(user_id);console.log(classprogressid);
        openIframeLayer("/teacher/review/evaluate/taskid/"+mytask_id+"/userId/"+user_id+'/classprogressid/'+classprogressid+'/group_id/'+group_id, '教师点评', {
            area: ['80%', '80%'],
        });
    }
    function refuse(mytask_id,user_id){

        if(confirm('确定要驳回么')==true){
            $.post("{:cmf_url('refuse')}",{mytask_id:mytask_id,user_id:user_id},function(data){
                if(data.code == 1){
                    alert('成功');
                }else{
                    alert('失败');
                }
            });
        }else{

           return false;

        }
    }
     function play(mytask_id,user_id,group_id){
        //console.log(mytask_id);console.log(user_id);console.log(classprogressid);
        openIframeLayer("/teacher/review/play/taskid/"+mytask_id+"/userId/"+user_id+'/group_id/'+group_id, '教师点评', {
            area: ['80%', '80%'],
        });
    }
</script>
</body>
</html>